// File:       ucex.c++
// Version:    1.00
// Author:     (c) Miles Sabin, 1997
// Purpose:    default uncaught exception handler

// Change log:
//   8/03/97   v. 1.00
//             Split off from exception


#include <stdio.h>
#include "exception.h"


extern "C" void __uncaught_exception(exception const* current_exception, exception const* previous_exception)
{
  if(current_exception == 0)
    fprintf(stderr, "Null exception thrown\n");
  else
  {
    if(previous_exception != 0)
      fprintf(stderr, "Exception '%s' thrown while handling exception '%s'\n", current_exception->what(), previous_exception->what());
    else
      fprintf(stderr, "Uncaught exception: %s\n", current_exception->what());
  }
}
